package service;

import dao.AssistantDao;
import dao.domain.Assistant;
import dao.domain.Book;
import dao.domain.Sell;
import dao.impl.AssistantDaoImpl;

import java.sql.SQLException;
import java.util.List;

/**
 * @author gzb
 */
public class AssistantService {

    private static final AssistantDao ASSISTANT_DAO = new AssistantDaoImpl();

    /**
     * 删除书籍
     */
    public static boolean deleteBook(Book book) throws SQLException {
        return BookService.delete(book);
    }

    /**
     * 修改书籍
     */
    public static void modifyBook(Book book) throws SQLException {
        BookService.update(book);
    }

    /**
     * 列出订单列表
     *
     * @return List储存的对象们
     */
    public static List<Sell> listSell() throws SQLException {
        return SellService.listSell();
    }

    public static void save(Assistant assistant) throws SQLException {
        ASSISTANT_DAO.save(assistant);
    }
}
